def gcd(a, b):
    if a < b:
        gcd(b, a)
    elif a % b != 0:
        return gcd(b, a % b)
    else :
        return b

def lcm(a, b):
    if a < b:
        return lcm(b, a)
    else:
        return a * gcd(a, b)
print(gcd(18, 12))